package com.example.yx1.demo39;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan
public class A39 {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(A39.class);

        Bean1 bean1 = (Bean1) context.getBean("bean1");
        System.out.println(bean1);
        System.out.println("工厂对象: " + context.getBean("&bean1"));

        context.close();
    }
}
